import 'package:flutter/material.dart';
import 'package:flutter_yd_simple/Project/Server/signOrderRequest.dart';

class ZCWSignOrderDemo extends StatefulWidget {
  const ZCWSignOrderDemo({super.key});

  @override
  State<ZCWSignOrderDemo> createState() => _ZCWSignOrderDemoState();
}

class _ZCWSignOrderDemoState extends State<ZCWSignOrderDemo> {

  var itemAry =[{"mailNo":"4001234567890","recStreet":"徐泾镇虹桥世界中心-D2","recName":"梁少爷","recTel":"18337100000","select":0},
                {"mailNo":"4001234567891","recStreet":"徐泾镇虹桥世界中心-D1","recName":"徐小姐","recTel":"18337100001","select":0},
                {"mailNo":"4001234567892","recStreet":"徐泾镇虹桥世界中心-D3","recName":"张大宝","recTel":"18337100002","select":0},
                {"mailNo":"4001234567893","recStreet":"徐泾镇虹桥世界中心-L2","recName":"王二狗","recTel":"18337100003","select":0},
                {"mailNo":"4001234567894","recStreet":"徐泾镇虹桥世界中心-L1","recName":"李老板","recTel":"18337100004","select":0},
                {"mailNo":"4001234567890","recStreet":"徐泾镇虹桥世界中心-D2","recName":"梁少爷","recTel":"18337100000","select":0},
                {"mailNo":"4001234567891","recStreet":"徐泾镇虹桥世界中心-D1","recName":"徐小姐","recTel":"18337100001","select":0},
                {"mailNo":"4001234567892","recStreet":"徐泾镇虹桥世界中心-D3","recName":"张大宝","recTel":"18337100002","select":0},
                {"mailNo":"4001234567893","recStreet":"徐泾镇虹桥世界中心-L2","recName":"王二狗","recTel":"18337100003","select":0},
                {"mailNo":"4001234567894","recStreet":"徐泾镇虹桥世界中心-L1","recName":"李老板","recTel":"18337100004","select":0},
                {"mailNo":"4001234567895","recStreet":"徐泾镇虹桥世界中心-L3","recName":"赵秘书","recTel":"18337100005","select":0}];

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    
    var dataList = HomeRequest().getHomeList(1,20);

  }
  
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Color(0xFFF6F8FA),
      child: GridView.builder(
      shrinkWrap: true, // 需要这个属性使得GridView的高度被子组件撑开
      padding: EdgeInsets.all(8),
      itemCount: itemAry.length,
      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
        crossAxisCount: 3,
        crossAxisSpacing: 8.0,
        mainAxisSpacing: 8.0,
        childAspectRatio: 0.67,
      ),
      itemBuilder: (context, index) {
        return GestureDetector(
          child: Container(
            color: Colors.white,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                 AspectRatio(
                   aspectRatio: 1,
                  /*
                  child:Image.network('src',
                    fit:BoxFit.cover
                  ),
                  */
                  child: Image.asset("lib/Project/Images/Home/home_todo_Icon.png"),
                ),
                Text('  data'),
                Row(
                  children: [
                    Text(' '),
                    Image.asset("lib/Project/Images/Home/home_todo_Icon.png",width: 30,height: 30),
                    Text('张赛')
                  ],
                ),
                SizedBox(height: 10)
              ],
            ),
          ),
          onTap: () {
            

          },
        );
      }
    )
    );
  }
}